{==============================================================================}
{  Acroprise Multi-Language Components                                         }
{                                                                              }
{  Copyright (C), 1999-2012, Acroprise Inc.                                    }
{  http://www.acroprise.com.tw                                                 }
{  ALL RIGHTS RESERVED                                                         }
{                                                                              }
{  Author   : Mustapha.Wang                                                    }
{  Version  : 4.1.15.2159                                                      }
{  Creation : 2002/05/06                                                       }
{  Revision :                                                                  }
{  Task     :                                                                  }
{==============================================================================}
unit acroDelphiDBClassMethod_vcl;
{$I acroMultiLang.Inc}
interface
uses
  Classes,acroMultiClassMethod,SysUtils;

implementation

uses
  DB
  {$IFNDEF Delphi15High}
  ,DBGrids,DBCtrls
  {$ELSE}
  ,VCL.DBGrids,VCL.DBCtrls
  {$ENDIF}
  ;
type
  TCustomDBGrid_Temp=class(TCustomDBGrid);

procedure Proc_TCustomDBGrid(ATable:IDataLocate;AComponent:TObject;
  ALCID,ASeqNo:string;AParams:TStringList);
var
  i:integer;
begin
  for i:=0 to TCustomDBGrid_Temp(AComponent).Columns.Count-1 do
  begin
    TCustomDBGrid_Temp(AComponent).Columns[i].Title.Caption:=
      GetDisplayValue(ATable,TCustomDBGrid_Temp(AComponent).Columns[i].Title.Caption,
        ALCID,ASeqNo,TCustomDBGrid_Temp(AComponent).Columns[i].Title,'Caption');
  end;
end;

procedure Proc_TDBNavigator(ATable:IDataLocate;AComponent:TObject;
  ALCID,ASeqNo:string;AParams:TStringList);
var
  i:integer;
begin
  for i:=0 to TDBNavigator(AComponent).Hints.Count-1 do
  begin
    TDBNavigator(AComponent).Hints[i]:=
      GetDisplayValue(ATable,TDBNavigator(AComponent).Hints[i],ALCID,ASeqNo,
        TDBNavigator(AComponent).Hints,InttoStr(i));
  end;
end;

initialization
  acroClassMethodStorage.RegisterClassMethod(TCustomDBGrid,Proc_TCustomDBGrid);
  acroClassMethodStorage.RegisterClassMethod(TDBNavigator,Proc_TDBNavigator);
finalization
  acroClassMethodStorage.UnRegisterClassMethod(TCustomDBGrid);
  acroClassMethodStorage.UnRegisterClassMethod(TDBNavigator);
end.
